/***********************************************************************
    filename:   DaterMainCalendarDayWindow.h
    created:    10/4/2012
    author:     4Ys

    purpose:    Defines class for MainCalendarDayWindow objects in UI
*************************************************************************/
#ifndef _DaterSearchWindow_h_
#define _DaterSearchWindow_h_

#include "cegui.h"
#include "DaterBaseWindow.h"
#include "DaterRecUser.h"
#include "DaterRecGroup.h"

#include <vector>

class SearchWindow : public BaseWindow 
{
	/* !
	\brief
		The Events in Day version.
	*/
public:
		/* !
		\brief
			Construct the sample of class MainCalendarDayWindow.

		\param id_name
			- a string to represent the prefix of the window.
			
		\param parent
			- point to parent window.
		*/
	SearchWindow(const CEGUI::String& id_name, CEGUI::Window* parent = 0);
	
		/* !
			Destructor of class MainCalendarDayWindow.
		*/
	virtual ~SearchWindow();

		/* !
		\brief
			a virtual function generated from class MainCalendarWindow to show window.
		*/
	virtual void showWindow();
	
		/* !
		\brief
			a virtual function generated from class MainCalendarWindow to hide window.
		*/
	virtual void hideWindow();

		/* !
		\brief
			a virtual function to set the user's search result.
		*/
	void setUserSearchResult(const std::vector<Dater::BriefUserInfo>&);
	
		/* !
		\brief
			a virtual function to set the group's search result.
		*/
	void setGroupSearchResult(const std::vector<Dater::BriefGroupInfo>&);

		/* !
		\brief
			a virtual function to show warning window.
		*/
	void showWarningWindow(std::string warningMessage);

private:
	bool handle_CloseButton(const CEGUI::EventArgs& args);

	bool handle_SearchUser(const CEGUI::EventArgs& args);

	bool handle_SearchGroup(const CEGUI::EventArgs& args);

	bool handle_showResultOperation(const CEGUI::EventArgs& args);

	bool handle_hideResultOperation(const CEGUI::EventArgs& args);

	bool handle_mouseWheel(const CEGUI::EventArgs& args);

	bool handle_lookGroupInfo(const CEGUI::EventArgs& args);

	bool handle_joinGroup(const CEGUI::EventArgs& args);

	bool handle_sendFinalJoinGroupRequest(const CEGUI::EventArgs& args);

	bool handle_closeReasonWindow(const CEGUI::EventArgs& args);

	bool handle_closeWarningWindow(const CEGUI::EventArgs& args);

	void clearUserSearchResult();
	void clearGroupSearchResult();

	std::vector<Dater::BriefUserInfo> _userSearchResult;
	std::vector<Dater::BriefGroupInfo> _groupSearchResult;

	int _selectUserIndex;
	int _selectGroupIndex;
};

#endif